﻿using LY.Entity;
using LY.Entity.Entities;
using LY.Entity.PageSearch;
using LY.Entity.SearchEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LY.Interface
{
    public interface IInvestService
    {
        PagedList<T_Investment_EX> QueryInvestList(InvestSearch search, PageView view);

        List<T_Investment_EX> QueryInvestList(int pageindex,int memberId);
        int QueryInvestCount(int memberId);
        
        T_Investment_EX GetInvest(int? Id);

        /// <summary>
        /// 显示投标的用户信息
        /// </summary>
        /// <returns></returns>
        //List<T_Investment_EX> GetInvestmentList(int projectid);
        //PagedList<T_Investment_EX> GetInvestmentList(int projectid, ProjectSearch search, PageView view);

        PagedList<T_Investment_EX> GetInvestmentList(int id, int projectid, ProjectSearch search, PageView view);

        int SaveRept(int? projectid, string name, int? id, double fee);

        int SaveReptPrincipal(int? projectid, string name, int? id, double? OutPay);



        /// <summary>
        /// 显示最新投标的用户信息
        /// </summary>
        /// <returns></returns>
        List<T_Investment_EX> GetInvestment();
        /// <summary>
        /// 用户投标排行
        /// </summary>
        /// <returns></returns>
        List<T_Investment_EX> GetInverstmentRanking();

        //用户投资还款计划
        List<T_RepaymentPlan_EX> GetRepList(int? tid, int mid);

        /// <summary>
        /// 显示最新投标Id
        /// </summary>
        /// <returns></returns>
        int GetLastId();

        /// <summary>
        /// 根据时间获取Id
        /// </summary>
        /// <returns></returns>
        int GetIdByCreatTime(DateTime time);

        /// <summary>
        /// 更具ID 修改状态和时间
        /// </summary>
        /// <param name="submitBidNo"></param>
        /// <param name="time"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        int Update(string submitBidNo, DateTime time, int status);
        //int UpdateProject(string projectId, DateTime time, int status);
        //int GetIdBySubmitNo(string submitNo);

        /// <summary>
        /// 项目已投金额
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        decimal MoneyCount(int projectId);

        /// <summary>
        /// 根据时间查询出投标的订单号
        /// </summary>
        /// <param name="time"></param>
        /// <returns></returns>
        string GetBidNoByCreatTime(DateTime time);

        /// <summary>
        /// 根据标号查询出投资人的信息列表
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<T_Investment_EX> GetSftInvestment(int projectId);

        /// <summary>
        /// 根据submitbidno查询出一个对象
        /// </summary>
        /// <param name="submitBidNo"></param>
        /// <returns></returns>
        T_Investment_EX GetInvestmentBySubmitBidNo(string submitBidNo);

        int SaveInvestment(T_Investment investment);

        T_Investment GetModelBySubmitBidNo(string submitBidNo);

        List<T_Investment_EX> QueryInvestmentList(int projectid, int repaymentPlanId);

        /// <summary>
        /// 查询溢出的这个标的投资情况
        /// </summary>
        /// <param name="search"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        PagedList<T_Investment> QueryInvestmentList(InvestSearch search, PageView view);

        /// <summary>
        /// 获取实体对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T_Investment GetModel(int id);
    }
}
